Skip to content

Enhance authentication UI and implement Focus feature set#35

Merged
tqha1011 merged 33 commits intomainfrom
features/compact_authScreen
Apr 12, 2026
Merged

Enhance authentication UI and implement Focus feature set#35
tqha1011 merged 33 commits intomainfrom
features/compact_authScreen

Conversation

@hoanghaoz
Copy link
Copy Markdown
Collaborator

@hoanghaoz hoanghaoz commented Apr 11, 2026

Summary by CodeRabbit

  • New Features

    • Introduced responsive compact layout mode for authentication screens that automatically adapts to smaller viewport heights.
  • Style

    • Optimized footer styling with refined padding and typography sizing on login and registration screens.
    • Enhanced spacing and visual hierarchy throughout authentication views for improved mobile and compact device experience.

hoanghaoz and others added 30 commits March 24, 2026 16:04
- Added Pomodoro timer with Start/Reset/Skip logic.
- Integrated local Quick Notes with Pin/Delete functionality.
- Supported image attachments in notes using image_picker.
- Added Focus settings: time duration, vibration, and ringtones.
Fixed 3 file(s) based on 4 unresolved review comments.

Co-authored-by: CodeRabbit <[email protected]>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 11, 2026

📝 Walkthrough

Walkthrough

The pull request introduces a compact layout mode to the authentication template that dynamically adjusts spacing, padding, and typography based on a compactMode flag or screen height constraints (≤780px). This mode is enabled in both login and register views with reduced footer styling.

Changes

Cohort / File(s) Summary
Compact Layout Mode Implementation
src/lib/core/theme/auth_layout_template.dart
Added compactMode boolean parameter (default false) and refactored layout construction with LayoutBuilder to compute responsive isCompact state. Adjusted header icon size, typography sizes, padding, spacing, container sizing, and button dimensions throughout the widget to respond to compact mode.
Auth Views Compact Mode Adoption
src/lib/features/auth/presentation/view/login_view.dart, src/lib/features/auth/presentation/view/register_view.dart
Enabled compactMode: true in AuthLayoutTemplate initialization. Reduced footer bottom padding from 24.0 to 14.0 and decreased footer text font size from 16 to 15. Added styling constraints to footer buttons with reduced minimum heights from 48 to 40.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • tqha1011

Poem

🐰 Hop hop, the layouts shrink with glee,
Compact mode for screens less free,
Padding shrinks and fonts align,
Responsive UI, oh how divine! 🎨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title mentions 'Focus feature set' but the actual changes focus solely on enhancing authentication UI with a compact mode implementation. No Focus-related features are present in the changeset. Update the title to accurately reflect the changes, such as 'Add compact mode to authentication UI layout' or 'Implement responsive compact mode for auth screens'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch features/compact_authScreen

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/lib/features/auth/presentation/view/login_view.dart (1)

106-139: Footer UI is now duplicated across auth views.

Consider extracting this footer into a shared widget/helper to keep compact-style tweaks in one place.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/lib/features/auth/presentation/view/login_view.dart` around lines 106 -
139, The _buildFooter method duplicates footer UI across auth views; extract it
into a reusable widget (e.g., AuthFooter or FooterButton) so style tweaks live
in one place: create a stateless widget that accepts text, action, and
VoidCallback onTap and internally uses the same Padding/Row/Text/TextButton and
Theme-based TextStyles, replace calls to _buildFooter in LoginView (and other
auth views) with the new widget to centralize styling and behavior.
src/lib/core/theme/auth_layout_template.dart (1)

68-93: Consider centralizing compact spacing/sizing tokens.

There are many repeated compact/non-compact literals. Extracting them into named constants (or a small token object) would make future layout tuning safer and faster.

Also applies to: 112-114, 133-143, 161-162, 188-197, 220-221, 235-293

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/lib/core/theme/auth_layout_template.dart` around lines 68 - 93, The code
repeats compact vs non-compact numeric literals (e.g., padding
EdgeInsets.fromLTRB(..., isCompact ? 8.0 : 16.0, ..., isCompact ? 16.0 : 36.0),
SizedBox heights, and other spacing across methods like _buildHeader,
_buildCardContainer, and _buildTransparentContainer), so create a small
centralized spacing token set (e.g., a private class or const map such as
_AuthLayoutSpacing with properties like horizontalPadding, headerTopCompact,
headerTopRegular, cardVerticalCompact, cardVerticalRegular, gapSmall, gapLarge)
and replace all inline ternary literals with those tokens keyed by isCompact;
update uses in the SingleChildScrollView padding, SizedBox heights, and any
other occurrences (including footer spacing) to reference the tokens so future
tuning only changes the token definitions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/lib/features/auth/presentation/view/login_view.dart`:
- Line 83: The TextButton touch target is set to a 40dp minimum height which is
below accessibility guidelines; update the TextButton.styleFrom(minimumSize:
const Size(50, 40), ...) instances in login_view.dart (e.g., the style usage in
the widget building code around the login view) to use a minimum height of 48
(e.g., Size(50, 48)) and adjust the other occurrence mentioned (line ~126)
similarly so all interactive buttons meet the 48dp touch target recommendation.

---

Nitpick comments:
In `@src/lib/core/theme/auth_layout_template.dart`:
- Around line 68-93: The code repeats compact vs non-compact numeric literals
(e.g., padding EdgeInsets.fromLTRB(..., isCompact ? 8.0 : 16.0, ..., isCompact ?
16.0 : 36.0), SizedBox heights, and other spacing across methods like
_buildHeader, _buildCardContainer, and _buildTransparentContainer), so create a
small centralized spacing token set (e.g., a private class or const map such as
_AuthLayoutSpacing with properties like horizontalPadding, headerTopCompact,
headerTopRegular, cardVerticalCompact, cardVerticalRegular, gapSmall, gapLarge)
and replace all inline ternary literals with those tokens keyed by isCompact;
update uses in the SingleChildScrollView padding, SizedBox heights, and any
other occurrences (including footer spacing) to reference the tokens so future
tuning only changes the token definitions.

In `@src/lib/features/auth/presentation/view/login_view.dart`:
- Around line 106-139: The _buildFooter method duplicates footer UI across auth
views; extract it into a reusable widget (e.g., AuthFooter or FooterButton) so
style tweaks live in one place: create a stateless widget that accepts text,
action, and VoidCallback onTap and internally uses the same
Padding/Row/Text/TextButton and Theme-based TextStyles, replace calls to
_buildFooter in LoginView (and other auth views) with the new widget to
centralize styling and behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: aaf5f13b-19bf-48d0-b08b-6286bdc9dcc4

📥 Commits

Reviewing files that changed from the base of the PR and between 7a77888 and c1075b1.

📒 Files selected for processing (3)
  • src/lib/core/theme/auth_layout_template.dart
  • src/lib/features/auth/presentation/view/login_view.dart
  • src/lib/features/auth/presentation/view/register_view.dart

),
TextButton(
onPressed: () => Navigator.push(context, MaterialPageRoute(builder: (_) => const ForgotPasswordView())),
style: TextButton.styleFrom(minimumSize: const Size(50, 40), padding: const EdgeInsets.symmetric(horizontal: 4)),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Keep interactive touch targets at least 48dp height.

Reducing button minimum height to 40 may make tap targets too small on mobile. Prefer 48 for better accessibility and usability consistency.

Suggested adjustment
- style: TextButton.styleFrom(minimumSize: const Size(50, 40), padding: const EdgeInsets.symmetric(horizontal: 4)),
+ style: TextButton.styleFrom(minimumSize: const Size(50, 48), padding: const EdgeInsets.symmetric(horizontal: 4)),
...
- style: TextButton.styleFrom(minimumSize: const Size(50, 40)),
+ style: TextButton.styleFrom(minimumSize: const Size(50, 48)),

Also applies to: 126-126

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/lib/features/auth/presentation/view/login_view.dart` at line 83, The
TextButton touch target is set to a 40dp minimum height which is below
accessibility guidelines; update the TextButton.styleFrom(minimumSize: const
Size(50, 40), ...) instances in login_view.dart (e.g., the style usage in the
widget building code around the login view) to use a minimum height of 48 (e.g.,
Size(50, 48)) and adjust the other occurrence mentioned (line ~126) similarly so
all interactive buttons meet the 48dp touch target recommendation.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the shared authentication layout and the login/register screens to support a more compact UI presentation on smaller viewports.

Changes:

  • Add compactMode support to AuthLayoutTemplate and make the layout responsive via LayoutBuilder.
  • Reduce spacing and font sizes across auth screens (header, form spacing, footer).
  • Adjust button sizing/padding for “compact” auth flows (login/register).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.

File Description
src/lib/features/auth/presentation/view/register_view.dart Enables compact auth layout and tightens footer spacing/button sizing.
src/lib/features/auth/presentation/view/login_view.dart Enables compact auth layout; tightens footer and “forgot password” button sizing.
src/lib/core/theme/auth_layout_template.dart Introduces compactMode + responsive compact sizing across the shared auth UI template.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +66 to +69
body: LayoutBuilder(
builder: (context, constraints) {
final isCompact = compactMode || constraints.maxHeight <= 780;

Comment on lines +66 to +68
body: LayoutBuilder(
builder: (context, constraints) {
final isCompact = compactMode || constraints.maxHeight <= 780;
disabledBackgroundColor:
Theme.of(context).colorScheme.primary.withValues(alpha: 0.6),
padding: const EdgeInsets.symmetric(vertical: 20),
padding: EdgeInsets.symmetric(vertical: isCompact ? 14 : 20),
Comment on lines 267 to 271
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
),
padding: const EdgeInsets.symmetric(vertical: 14),
padding: EdgeInsets.symmetric(vertical: isCompact ? 10 : 14),
),
child: Icon(
Icons.task_alt,
size: 48,
size: isCompact ? 36 : 48,
TextButton(
onPressed: () => Navigator.pop(context),
style: TextButton.styleFrom(minimumSize: const Size(50, 48)),
style: TextButton.styleFrom(minimumSize: const Size(50, 40)),
),
TextButton(
onPressed: () => Navigator.push(context, MaterialPageRoute(builder: (_) => const ForgotPasswordView())),
style: TextButton.styleFrom(minimumSize: const Size(50, 40), padding: const EdgeInsets.symmetric(horizontal: 4)),
TextButton(
onPressed: onTap,
style: TextButton.styleFrom(minimumSize: const Size(50, 48)),
style: TextButton.styleFrom(minimumSize: const Size(50, 40)),
Comment on lines 21 to 26
builder: (context, _) => AuthLayoutTemplate(
title: 'Task Management',
subtitle: 'Chào mừng trở lại!',
submitText: 'Đăng nhập',
compactMode: true,
isLoading: _vm.isLoading,
@tqha1011 tqha1011 merged commit 986a56d into main Apr 12, 2026
6 checks passed
tqha1011 added a commit that referenced this pull request Apr 18, 2026
* Feature/user profile (#30)

* feat(UserProfile): build screen UserProfile

# Conflicts:
#	src/lib/features/main/view/screens/main_screen.dart

* feat: switch dark/light theme

* fix: black color theme

* fix: black theme in statistics screen

* feat: add dark theme to auth screen

* feat: apply dark theme for bottom navigation bar

* feat(priority task):Implement priority and tag selection in task creation version 1 (#31)

* feat(task): implement priority and tag selection features in task creation

* Update README.md

* Update README.md

* Update README.md

---------

Co-authored-by: Tran Quang Ha <[email protected]>

* Update README.md (#32)

* feat: Priority selector and tag system verson2 (#33)

* feat(task): implement priority and tag selection features in task creation

* feat(tags): enhance tag management with custom tag creation and selection

* Update README.md

* Update README.md

* fix: error screen in main.dart (#34)

* Enhance authentication UI and implement Focus feature set (#35)

* feat(core): add auth layout template, custom textfield and colors

* feat(auth): implement viewmodels for auth flow (MVVM)

* feat(auth): build complete auth UI screens (Login, Register, OTP, Passwords)

* chore(main): set LoginView as initial route

* refactor(auth) : delete .gitkeep

* chore: update dependencies and pubspec.lock

* refactor(auth): optimize registration logic, timezone handling, and form validation

* feat(auth): update UI for login, registration, and forgot password screens

* feat(tasks): update task management UI and statistics screen

* chore: update main entry point and fix widget tests

* chore: ignore devtools_options.yaml

* chore: ignore devtools_options.yaml

* style(login) : rewrite title for login view

* feat(auth): configure android deep link for supabase oauth

* refactor(ui): add social login callbacks to auth layout template

* feat(auth): update oauth methods with redirect url and signout

* feat(auth): implement AuthGate using StreamBuilder for session tracking

* feat(viewmodel): add oauth logic and improve provider lifecycle

* refactor(ui): migrate LoginView to Provider pattern

* chore(main): set AuthGate as initial route and setup provider

* feat: implement full Focus feature set

- Added Pomodoro timer with Start/Reset/Skip logic.
- Integrated local Quick Notes with Pin/Delete functionality.
- Supported image attachments in notes using image_picker.
- Added Focus settings: time duration, vibration, and ringtones.

* fix (auth) : dispose TextEditingControllers to prevent memory leaks

* refactor (alarm ) : create off alarm button  when time out

* fix: apply CodeRabbit auto-fixes

Fixed 3 file(s) based on 4 unresolved review comments.

Co-authored-by: CodeRabbit <[email protected]>

* fix(timer): prevent division by zero in progress calculation and sanitize negative settings input

* fix(timer): prevent division by zero in progress calculation and sanitize negative settings input

* fix(auth): unblock new-user login and add settings logout

* refactor(LoginScreen) : compact all items to fit in screen to help users interface easily

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: CodeRabbit <[email protected]>

* build(deps)(deps): bump shared_preferences from 2.5.4 to 2.5.5 in /src (#36)

Bumps [shared_preferences](https://github.com/flutter/packages/tree/main/packages/shared_preferences) from 2.5.4 to 2.5.5.
- [Commits](https://github.com/flutter/packages/commits/shared_preferences-v2.5.5/packages/shared_preferences)

---
updated-dependencies:
- dependency-name: shared_preferences
  dependency-version: 2.5.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Feature/user profile (#37)

* feat(UserProfile): build screen UserProfile

# Conflicts:
#	src/lib/features/main/view/screens/main_screen.dart

* feat: switch dark/light theme

* fix: black color theme

* fix: black theme in statistics screen

* feat: add dark theme to auth screen

* feat: apply dark theme for bottom navigation bar

* feat(RPC): update RPC to get data for heatmap

* feat(RPC): update new RPC to get data for heatmap

* feat: integrate chatbot assistant

* feat(chatbot): integrate create task, answer question for chatbot

* feat: remove mock data and get data tags and categories from supabase

* feat: integrate chatbot's ability to create task

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Nguyễn Anh Kiệt <[email protected]>
Co-authored-by: Nguyễn Lê Hoàng Hảo <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: CodeRabbit <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
tqha1011 added a commit that referenced this pull request Apr 18, 2026
* feat: add create task screen and fix home screen provider errors

* Feature/user profile (#30)

* feat(UserProfile): build screen UserProfile

# Conflicts:
#	src/lib/features/main/view/screens/main_screen.dart

* feat: switch dark/light theme

* fix: black color theme

* fix: black theme in statistics screen

* feat: add dark theme to auth screen

* feat: apply dark theme for bottom navigation bar

* feat(priority task):Implement priority and tag selection in task creation version 1 (#31)

* feat(task): implement priority and tag selection features in task creation

* Update README.md

* Update README.md

* Update README.md

---------

Co-authored-by: Tran Quang Ha <[email protected]>

* Remove comment about main UI in home_screen.dart

Removed commented section about main UI.

* Update README.md (#32)

* feat: Priority selector and tag system verson2 (#33)

* feat(task): implement priority and tag selection features in task creation

* feat(tags): enhance tag management with custom tag creation and selection

* Update README.md

* Update README.md

* fix: error screen in main.dart (#34)

* Enhance authentication UI and implement Focus feature set (#35)

* feat(core): add auth layout template, custom textfield and colors

* feat(auth): implement viewmodels for auth flow (MVVM)

* feat(auth): build complete auth UI screens (Login, Register, OTP, Passwords)

* chore(main): set LoginView as initial route

* refactor(auth) : delete .gitkeep

* chore: update dependencies and pubspec.lock

* refactor(auth): optimize registration logic, timezone handling, and form validation

* feat(auth): update UI for login, registration, and forgot password screens

* feat(tasks): update task management UI and statistics screen

* chore: update main entry point and fix widget tests

* chore: ignore devtools_options.yaml

* chore: ignore devtools_options.yaml

* style(login) : rewrite title for login view

* feat(auth): configure android deep link for supabase oauth

* refactor(ui): add social login callbacks to auth layout template

* feat(auth): update oauth methods with redirect url and signout

* feat(auth): implement AuthGate using StreamBuilder for session tracking

* feat(viewmodel): add oauth logic and improve provider lifecycle

* refactor(ui): migrate LoginView to Provider pattern

* chore(main): set AuthGate as initial route and setup provider

* feat: implement full Focus feature set

- Added Pomodoro timer with Start/Reset/Skip logic.
- Integrated local Quick Notes with Pin/Delete functionality.
- Supported image attachments in notes using image_picker.
- Added Focus settings: time duration, vibration, and ringtones.

* fix (auth) : dispose TextEditingControllers to prevent memory leaks

* refactor (alarm ) : create off alarm button  when time out

* fix: apply CodeRabbit auto-fixes

Fixed 3 file(s) based on 4 unresolved review comments.

Co-authored-by: CodeRabbit <[email protected]>

* fix(timer): prevent division by zero in progress calculation and sanitize negative settings input

* fix(timer): prevent division by zero in progress calculation and sanitize negative settings input

* fix(auth): unblock new-user login and add settings logout

* refactor(LoginScreen) : compact all items to fit in screen to help users interface easily

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: CodeRabbit <[email protected]>

* build(deps)(deps): bump shared_preferences from 2.5.4 to 2.5.5 in /src (#36)

Bumps [shared_preferences](https://github.com/flutter/packages/tree/main/packages/shared_preferences) from 2.5.4 to 2.5.5.
- [Commits](https://github.com/flutter/packages/commits/shared_preferences-v2.5.5/packages/shared_preferences)

---
updated-dependencies:
- dependency-name: shared_preferences
  dependency-version: 2.5.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Feature/user profile (#37)

* feat(UserProfile): build screen UserProfile

# Conflicts:
#	src/lib/features/main/view/screens/main_screen.dart

* feat: switch dark/light theme

* fix: black color theme

* fix: black theme in statistics screen

* feat: add dark theme to auth screen

* feat: apply dark theme for bottom navigation bar

* feat(RPC): update RPC to get data for heatmap

* feat(RPC): update new RPC to get data for heatmap

* feat: integrate chatbot assistant

* feat(chatbot): integrate create task, answer question for chatbot

* feat: remove mock data and get data tags and categories from supabase

* fixed codes, added save delete and create tasks and notes

* Delete .vs/TaskManagement.slnx/v18/.wsuo

* Delete .vs directory

* Delete .vscode directory

* Delete src/.gitignore

* Delete src/lib/features/auth/viewmodels/task_provider.dart

* Delete src/web_entrypoint.dart

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Tran Quang Ha <[email protected]>
Co-authored-by: Nguyễn Anh Kiệt <[email protected]>
Co-authored-by: Nguyễn Lê Hoàng Hảo <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: CodeRabbit <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants